package com.scs.application.modules.wm.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.scs.application.core.service.BaseServiceImpl;
import com.scs.application.core.utils.DateUtils;
import com.scs.application.modules.wm.entity.OrderBarcodeout;
import com.scs.application.modules.wm.mapper.OrderBarcodeoutMapper;
import com.scs.application.modules.wm.service.OrderBarcodeoutService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 */
@Service
public class OrderBarcodeoutServiceImpl extends BaseServiceImpl<OrderBarcodeoutMapper, OrderBarcodeout> implements OrderBarcodeoutService {

    @Override
    @Transactional(rollbackFor = Exception.class)
    /**
    * @Description： 批量更新打印时间和打印状态
    */
    public void updatePrintRefFields(List<String> rfidList) {
        if (rfidList == null || rfidList.size() < 1) return;
        this.update(Wrappers.<OrderBarcodeout>update().set("print_time",DateUtils.now()).set("flag_print","1").in("rfid",rfidList));
    }

}
